Adding Parameter Input to the Report

Banded Reports obtain query results from the DataBlock to report on the contents of a database. Other information not contained within the report query can be obtained and inserted into your report, including items such as:

Tip: Adding the selections made within the DataBlock form to the report provides very useful background information used to create the report.

To obtain this information you need to add an expression field into the desired band using methods you are now familiar with. This is done by clicking the E=mc2 icon Add expression field icon. The icon has e equals m c squared on it. on the Band Report Editor Toolbar, then clicking within the band where you want the field to be placed.

Edit expression field dialog box. The expression field is near the top of the dialog box. Other options, such as font and alignment, can also be adjusted here.

Click on the ellipses icon ellipses icon to the right of the expression box to launch the Expression Editor.

Expression wizard dialog. There is an empty text field for building an expression. Below the text field are buttons to enter database fields, functions, and variables. There are also buttons to add mathematical and boolean operators (e g not, and, or).

The Expression dialog boxes above are displayed. From the Expression Wizard, click the “Variable” button which displays the list of variables that can be inserted into the band. Variables preceded with a $ are system variables. Variables without the $ are items selected from the DataBlock form used to create the report.

Select variable screen on the expression wizard dialog.

For this example, the DataBlock name as well as the departments selected within the DataBlock form will be placed into Summary Band that was created in this example.

The DataBlock form for Example 1 consists of a list of department names which is contained in the variable LISTBOX1.DEPT_NAME shown at the bottom of the list in the above figure.

To add the selected department names into the Summary Band, click the LISTBOX1.DEPT_NAME variable and it will be placed within the band. When adding the expression to the band, select the “Autostretch height” box which will increase the height of the band, if necessary, to accommodate the list of selections from the form.

To add the DataBlock name to the Summary Band, repeat the above process to add an expression field and select the variable GETVARIABLE(‘$DATABLOCK.NAME’).

The report with the DataBlock name and selected query parameters in the Summary Band.

The DataBlock Name (User Guide) as well as the Departments selected within the DataBlock form (Product Dev, HR, Sales) now appear within the Summary Band. Labels (“DataBlock Name” and “Departments Selected”) were added separately to describe the newly added information.